package com.ghp.interfas.controller;

import cn.hutool.core.util.CharsetUtil;
import cn.hutool.http.HttpRequest;
import com.ghp.interfas.model.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ghp
 * @title
 * @description
 */
@RestController
@RequestMapping("/email")
public class EmailController {
    /**
     * 判断邮箱是否存在
     */
    /**
     * 随机获取网易云音乐
     */
    @PostMapping("/exits")
    public String randMusic(@RequestBody User user) {
        String url = "https://api.nbhao.org/v1/email/verify";
        return HttpRequest.post(url)
                .form("email", user.getEmail(), CharsetUtil.CHARSET_UTF_8).execute().body();
    }
}
